Skip to content

Conversation

@agoscinski
Copy link
Owner

No description provided.

agoscinski and others added 6 commits March 10, 2025 14:39
The force option gives the option to skip any action the process does to
properly release resources. This can result in orphan resources (e.g.
submitted jobs that are still running).

To test the feature we have to monkey patch the workers code. We thus
start a worker in a forked process to inherit the monkey patched
python context. The fixture `fork_worker_context` returns a
context manager that starts the worker with the aiida test profile and
terminates it.
I changed the killing calcjob to a the mock RunningProcess that stays in
running state. The tests before were not really testing if it was
killable during the running state as the ArithmeticAdd CalcJob goes
immediately to the Waiting state (while it is sleeping it is in waiting
state) and is then killable. Running can be blocking if the run_fn is
blocking, so no kill command can go through. I am not sure if it makes
sense to test these cases, since in the end we want to test if a CalcJob
does not get stuck during killing, we do not care so much about custom
Processes. I would go forward by only using ArithmeticAdd calcjob in the
tests 1-6.

From the tests for the EBM 7-11 I only kept 7. I think it is not
important to test that kill is getting stuck. I see some value in the
test 9, but kept it short for now. Let me know your opinion about which
tests to keep, I think before it were too many.
- Replace {Running,Waiting}Process with ArithmeticAddCalculation.
- Add tests 8),9) back
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants